package com.yanqu.road.server.cmd.activity.washe.cross;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.WasheProto;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.Command;
import com.yanqu.road.server.manger.activity.washe.WasheMgr;
import com.yanqu.road.server.protocol.GameProtocol;
import io.netty.channel.ChannelHandlerContext;

@Cmd(code = GameProtocol.S_WASHE_STATUS_FROM_CROSS, desc = "")
public class WasheStatusFromCrossCmd implements Command {

    @Override
    public void execute(ChannelHandlerContext ctx, YanQuMessage yanQuMessage) throws Exception {
        WasheProto.ChannelWasheStatusRespMsg respMsg = WasheProto.ChannelWasheStatusRespMsg.parseFrom(yanQuMessage.getBytes());

        // type1 开始游戏
        if (respMsg.getType() == 1) {
            WasheMgr.beginPing(yanQuMessage.getPlayerId());
        }
    }
}
